package com.learn.tx;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import javax.annotation.Resource;

/**
 * @author chenxin
 * @time 2017-01-06-14:34
 */
@ContextConfiguration(locations = {
        "classpath:applicationContext-annotation.xml",
})
@RunWith(SpringJUnit4ClassRunner.class)
public class TxTest {
    @Resource
    private TxMethod txMethod;

    @Test
    public void testTx(){
        TxObject tx = new TxObject();
        tx.setS("aaa");
        try {
            txMethod.addOne(tx);
        }
        finally {
            System.out.println(tx.getS());
        }

    }
}
